#pragma once

#include <string>
#include "tinyxml2.h"
using namespace tinyxml2;

class CXMLDoc
{
public:
	CXMLDoc(void);
	~CXMLDoc(void);

	bool initialize();
	bool LoadFile(const char* file);
	bool LoadFile( FILE* fp);

	XMLNode* getRoot();
	XMLNode* insertSub(XMLNode* node, const char*  content, bool isGenerateName = true);
	XMLNode* insertSibling(XMLNode* node, const char*  content, bool isGenerateName = true);
	bool saveFile(const char* filePath);
	bool saveFile(FILE* fp);
private:
	tinyxml2::XMLDocument* m_doc;
	std::string generateListNumberString(XMLNode* node);
};

